﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.WindowsMobile.Telephony;

namespace SmartDial
{
    public partial class frmMain : Form
    {
        public frmMain()
        {
            InitializeComponent();
        }

        private void menuItemClear_Click(object sender, EventArgs e)
        {
            labelPhoneNumber.Text = string.Empty;
        }

        private void menuItemExit_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void menuItemAbout_Click(object sender, EventArgs e)
        {
            frmAbout aboutForm = new frmAbout();
            aboutForm.ShowDialog();
        }

        private void menuItemDial_Click(object sender, EventArgs e)
        {
            Dial();
        }

        private void Dial()
        {
            new Phone().Talk(labelPhoneNumber.Text);
        }

        private void pictureBox_Click(object sender, EventArgs e)
        {
            labelPhoneNumber.Text += ((PictureBox)sender).Tag;
        }

        private void frmMain_Load(object sender, EventArgs e)
        {
            labelPhoneNumber.Text = string.Empty;
        }
    }
}